<template>
	<a-row :gutter="10" class="mb-2">
		<a-col :span="5">
			<Group :selectTree="selectTree" relationTypeCode="SCENE"></Group>
		</a-col>
		<a-col :span="19">
			<ProcessList
				:group-id="currentGroupId"
				:productId="proxy.$route.query.id"
				:processVersionCallback="props?.processVersionCallback"
			/>
		</a-col>
	</a-row>
</template>

<script setup name="ProcessManager">
import ProcessList from './ProcessList.vue'
import Group from '@/components/Group/index.vue'
import { onMounted, ref, getCurrentInstance } from 'vue'

const currentGroupId = ref()

const props = defineProps(['groupCallback', 'processVersionCallback'])

const { proxy } = getCurrentInstance()

const selectTree = (id, code, name) => {
	currentGroupId.value = id
	if (props.groupCallback) {
		props.groupCallback({
			groupId: id,
			groupCode: code,
			groupName: name
		})
	}
}
onMounted(() => {
})
</script>

<style scoped></style>
